﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using System.Data;
using SqlServerDAL;

public partial class AlertUI_InsuranceAlertView : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //FuncCheck();
            BindGridView();
        }
    }

    ////绑定分页和GridView方法
    private void BindGridView()
    {
        DataSet ds = new AlertDAL().GetAlertInsurance((int)Session["OrganID"]);
        //初始化分页数据源实例
        PagedDataSource pds = new PagedDataSource();
        //设置总行数
        AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
        //设置分页的数据源
        pds.DataSource = ds.Tables[0].DefaultView;
        //设置当前页
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        //设置每页显示页数
        pds.PageSize = AspNetPager1.PageSize;
        //启用分页
        pds.AllowPaging = true;
        //设置GridView的数据源为分页数据源
        GridView1.DataSource = pds;
        //绑定GridView
        GridView1.DataBind();
    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindGridView();
    }
    protected void btn_Search_Click(object sender, EventArgs e)
    {
        //Session["Where"] = " organID = " + Session["OrganID"].ToString() + " AND FrameNo LIKE '%" + txt_Search.Text.Trim() + "%'";
        //BindGridView();
    }
}
